package com.bs.dao.impl;

import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import com.bs.bean.Hospital;
import com.bs.dao.HospitalDAO;

public class HospitalDAOImpl extends SqlMapClientDaoSupport implements HospitalDAO {
	
	@Override
	public int delete(Hospital hospital) {
		return this.getSqlMapClientTemplate().delete("hospital.delete",hospital);
	}

	
	@Override
	public int batchDelete(String ids) {
		return this.getSqlMapClientTemplate().delete("hospital.batchDelete",ids);
	}


	public void save(Hospital hospital){
		System.out.println(this.getSqlMapClientTemplate().insert("hospital.save", hospital));
		
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Hospital> query(Hospital hospital) {
		return this.getSqlMapClientTemplate().queryForList("hospital.query",hospital);
	}

	
}
